package dongze.com.ckdj.databinding.model;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.util.Pair;
import android.view.View;
import android.widget.AdapterView;

import java.util.List;

import dongze.com.ckdj.BR;
import dongze.com.ckdj.databinding.BindingUtil;

/**
 * Created by fanqwz on 2017/7/20.
 */

public class VehicleNumberModel extends BaseObservable {
    String key;
    String value;
    String hint;

    @Bindable
    public String getCarColor() {
        return carColor;
    }

    public void setCarColor(String carColor) {
        this.carColor = carColor;
        notifyChange();
    }

    String carColor;

    @Bindable
    public int getVisibility() {
        return visibility;
    }

    public void setVisibility(int visibility) {
        this.visibility = visibility;
        notifyPropertyChanged(BR.visible);
    }

    int visibility = View.GONE;


    @Bindable
    public String getHint() {
        return hint;
    }

    public void setHint(String hint) {
        if (BindingUtil.isNotEqual(this.hint, hint)) {
            this.hint = hint;
            notifyPropertyChanged(BR.hint);
        }
    }

    int keyColor = 0xFF0000FF;
    int valueColor = 0xFF000000;

    @Bindable
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        if (BindingUtil.isNotEqual(this.key, key)) {
            this.key = key;
            notifyPropertyChanged(BR.key);
        }
    }

    @Bindable
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        if (BindingUtil.isNotEqual(this.value, value)) {
            this.value = value;
            notifyPropertyChanged(BR.value);
        }
    }

    public int getKeyColor() {
        return keyColor;
    }

    public void setKeyColor(int keyColor) {
        this.keyColor = keyColor;
        notifyChange();
    }

    public int getValueColor() {
        return valueColor;
    }

    public void setValueColor(int valueColor) {
        this.valueColor = valueColor;
        notifyChange();
    }

    @Bindable
    List<Pair<String, String>> entries;
    AdapterView.OnItemClickListener onItemClickListener;

    public List<Pair<String, String>> getEntries() {
        return entries;
    }

    public void setEntries(List<Pair<String, String>> entries) {
        if (this.entries != entries) {
            this.entries = entries;
            notifyPropertyChanged(BR.entries);
        }
    }

    @Bindable
    public AdapterView.OnItemClickListener getOnItemClickListener() {
        return onItemClickListener;
    }

    public void setOnItemClickListener(AdapterView.OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
        notifyPropertyChanged(BR.onItemClickListener);
    }
}
